﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using APH.Parl2.Client.Internet.MVC.Models;
using APH.Parl2.Client.Internet.MVC.Parl2DataServiceReference;

namespace APH.Parl2.Client.Internet.MVC.Controllers
{
    public class MemberController : Controller
    {
        //
        // GET: /Member/

        public ActionResult Index()
        {
            return View();
        }

        public ActionResult Member(int id)
        {
            ParliamentarianRepository rep = new ParliamentarianRepository();

            Parliamentarian parliamentarian = rep.GetParliamentarian(id);
            return View(parliamentarian);

        }

        public ActionResult AllMembers(string id)
        {
            ParliamentarianRepository rep = new ParliamentarianRepository();

            return View(rep.FindAllParliamentarians());

        }

        public ActionResult _MemberPartial(int id)
        {
            ParliamentarianRepository rep = new ParliamentarianRepository();
            Parliamentarian parliamentarian = rep.GetParliamentarian(id);
            return PartialView(parliamentarian);
        }
    }
}
